package com.qd.common.flow.domain.config;

import com.cdqidi.dict.annotation.FieldBind;
import com.cdqidi.util.page.BaseQuery;
import com.cdqidi.valid.group.DefaultGroup;
import com.cdqidi.valid.group.DeleteGroup;
import com.cdqidi.valid.group.UpdateGroup;
import com.qd.common.dict.DictConstant;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.time.LocalDateTime;

/**
 * 流程节点配置
 *
 * @author sjk
 */
@EqualsAndHashCode(callSuper = true)
@Getter
@Setter
public class FlowProcessNodeDTO extends BaseQuery {

    /**
     * 主键
     */
    @NotBlank(message = "节点ID不能为空", groups = {DeleteGroup.class, UpdateGroup.class})
    @Size(max = 50, message = "节点ID长度不能超过{max}位", groups = {DeleteGroup.class, UpdateGroup.class})
    private String nodeId;
    /**
     * 节点名称
     */
    @Size(max = 100, message = "节点名称长度不能超过{max}位", groups = DefaultGroup.class)
    private String nodeName;
    /**
     * 序号
     */
    @NotNull(message = "序号不能为空", groups = DefaultGroup.class)
    private Integer nodeNumber;
    /**
     * 添加时间
     */
    private LocalDateTime addTime;
    /**
     * 更新时间
     */
    private LocalDateTime updateTime;
    /**
     * 流程ID
     */
    @NotBlank(message = "流程ID不能为空", groups = DefaultGroup.class)
    @Size(max = 50, message = "流程ID长度不能超过{max}位", groups = DefaultGroup.class)
    @FieldBind(targetField = "processIdDisplay",processName = DictConstant.FLOW_PROCESS_CONFIG)
    private String processId;
    /**
     * 流程ID显示
     */
    private String processIdDisplay;
    /**
     * 机构ID
     */
    @Size(max = 50, message = "机构ID长度不能超过{max}位", groups = DefaultGroup.class)
    @FieldBind(targetField = "orgIdDisplay",processName = DictConstant.SYS_ORG)
    private String orgId;
    /**
     * 机构名称
     */
    private String orgIdDisplay;
    /**
     * 操作人
     */
    @Size(max = 50, message = "操作人长度不能超过{max}位", groups = DefaultGroup.class)
    @FieldBind(targetField = "operatorDisplay",processName = DictConstant.SYS_PERSON)
    private String operator;
    /**
     * 操作人姓名
     */
    private String operatorDisplay;
    /**
     * 是否启用
     */
    @Size(max = 64, message = "是否启用长度不能超过{max}位", groups = DefaultGroup.class)
    @FieldBind(targetField = "enableDisplay")
    private String enable;
    /**
     * 是否启用显示
     */
    private String enableDisplay;
    /**
     * 审批部门
     */
    @NotBlank(message = "审批部门不能为空", groups = DefaultGroup.class)
    @Size(max = 50, message = "审批部门长度不能超过{max}位", groups = DefaultGroup.class)
    @FieldBind(targetField = "approvalDepartDisplay",processName = DictConstant.SYS_ORG)
    private String approvalDepart;
    /**
     * 审批部门显示
     */
    private String approvalDepartDisplay;

    @Override
    public void freeData() {
        this.nodeId = null;
        this.nodeName = null;
        this.nodeNumber = null;
        this.addTime = null;
        this.updateTime = null;
        this.processId = null;
        this.orgId = null;
        this.orgIdDisplay = null;
        this.operator = null;
        this.operatorDisplay = null;
        this.enable = null;
        this.enableDisplay = null;
        this.approvalDepart = null;
        this.approvalDepartDisplay = null;
        super.freeData();
    }
}
